package com.euc.springbootframework.service.auth;

import com.euc.springbootframework.dao.RoleDao;
import com.euc.springbootframework.dao.base.BaseDao;
import com.euc.springbootframework.entity.Role;
import com.euc.springbootframework.service.base.RestBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleService extends RestBaseService<Role> {


    @Autowired
    private RoleDao roleBaseDao;

    @Override
    protected BaseDao<Role, String> getRepository() {
        return roleBaseDao;
    }

    public List<Role> findRolesByUsername(String username){
        return roleBaseDao.findByUsersUsername(username);
    }
}
